function _jasmine_combox_click (id) {
	if (document.onclick) document.onclick ();
	window.event.cancelBubble = true;
	var container = document.getElementById (id + "-container");
	var list = document.getElementById (id + "-list");
	list.className = "jasmine-list-body";
	var width = __IsIE__ ? container.offsetWidth : container.clientWidth;
	var height = container.offsetHeight;
	list.style.width = width + "px";
	var pos = org.dreamwork.js.util.Util.getPosition (container);
	list.style.left = pos.x + "px";
	list.style.top = (pos.y + height) + "px";
}

function _jasmine_close_list () {
    for (var i = 0; i < _comobbox_controls.length; i ++) {
	    document.getElementById (_comobbox_controls[i] + "-list").className = "jasmine-hidden-list-body";
    }
}

function _jasmine_hightlight (obj) {
	_jasmine_unhightlight (obj);
	obj.className = "jasmine-hightlight";
}

function _jasmine_unhightlight (obj) {
	var items = obj.parentNode.getElementsByTagName ("div");
	for (var i = 0; i < items.length; i ++) items [i].className = "";
}

function _jasmine_selectItem (obj) {
	var array = obj.id.split ("-");
	var id = array [0];
	var index = array [2];
	var data = _list_values [id];
	var new_value = data.values [index];
	var old_value = document.getElementById (id).value;
	document.getElementById (id + "-label").innerHTML = obj.innerHTML;
	if (new_value != old_value) {
        var control = document.getElementById (id);
		control.value = new_value;
        if (control.onchange) setTimeout (function () {control.onchange ();}, 0);
	}
}

var _list_values = {};
var _comobbox_controls = [];
document.onclick = _jasmine_close_list;